﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using EzDesk.Clients.DesktopWeb.AttendanceService;
using EzDesk.Clients.DesktopWeb.TopicService;
using EzDesk.EzAppApi.Utility;
using EzDesk.Utility.Generic;
using EzDesk.Utility.Log;
using Microsoft.Practices.Unity;
using EzDesk.Utility.Web.Controllers;
using EzDesk.Clients.DesktopWeb.ClientTokenService;

namespace EzDesk.Clients.DesktopWeb
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });


            routes.MapRoute(
                "NavigationList", // Route name
                "core/NavigationList/{pageName}", // URL with parameters
                new { controller = "Core", action = "NavigationList", pageName = UrlParameter.Optional } // Parameter defaults
            );

            routes.MapRoute(
                "HeadIcon", // Route name
                "core/headicon/{userId}", // URL with parameters
                new { controller = "Core", action = "HeadIcon", userId = UrlParameter.Optional } // Parameter defaults
            );

            routes.MapRoute(
                "StaffDefault", // Route name
                "staff", // URL with parameters
                new { controller = "staff", action = "staff" } // Parameter defaults
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );


        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }
    }
}